import { Empty } from 'antd';
import { replaceContent } from '@/utils';
// css
import styles from '@/styles/CommonDetail.module.scss';

export default function MyMessage({ priceDesc, method, note }) {
    const empty = !priceDesc && !method && !note;
    return (
        <div className={styles['message']} id="anchor-message">
            <h1 className={styles['common-title']}>
                <span className="iconfont icon-tongzhi"></span> 预订须知
            </h1>
            {
                empty
                ? <article><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无预订须知" /></article>
                : <article>
                    <span className={styles["sub-title-text"]}>费用说明</span>
                    <div dangerouslySetInnerHTML={{__html: replaceContent(priceDesc)}}></div>
                    <span className={styles["sub-title-text"]}>使用方法</span>
                    <div dangerouslySetInnerHTML={{__html: replaceContent(method)}}></div>
                    <span className={styles["sub-title-text"]}>注意事项</span>
                    <div dangerouslySetInnerHTML={{__html: replaceContent(note)}}></div>
                </article>
            }
        </div>
    )
}